package com.ocean.admin.extension;

import com.ocean.core.util.SpringContextUtil;
import com.ocean.core.util.constants.ConstantsCache;
import com.ocean.core.util.constants.properties.ProjectProperties;
import lombok.Getter;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

/**
 * 变量扩展
 *
 * @author zhang
 * @since 2024/5/19
 */
@Getter
@Component
public class ConstantsCacheExtension extends ConstantsCache {

    /**
     * 验证码
     */
    private final String verificationCode = getProject() + "verificationCode:";

    /**
     * 编号
     */
    private final String reportNo = getProject() + "reportNo:";

    /**
     * 字典缓存
     */
    private final String dicCache = getProject() + "dicCache:";

    /**
     * 系统日志
     */
    private final String sysOperType = getProject() + "sysOperType:";

    /**
     * 性别
     */
    private final String sysSex = "sysSex";

    public ConstantsCacheExtension(ProjectProperties projectProperties) {
        super(projectProperties);
    }

    public static ConstantsCacheExtension getInstance() {
        ApplicationContext context = SpringContextUtil.getApplicationContext();
        return context.getBean(ConstantsCacheExtension.class);
    }
}